<?php

namespace Xrfg\Core\Trading\SystemAccount\Models;

use Illuminate\Database\Eloquent\Model;
use Xrfg\Core\Trading\Account\Models\Coin;

class SystemAccount extends Model
{
    use SystemAccountLogHelper;

    protected $table = 'system_accounts';

    /**
     * @var int 充币账户
     */
    const TYPE_RECHARGE = 1;
    /**
     * @var int 提币账户
     */
    const TYPE_WITHDRAW = 2;
    /**
     * @var int 交易手续费账户
     */
    const TYPE_TRADE_FEE = 3;
    /**
     * @var int 提现手续费账户
     */
    const TYPE_WITHDRAW_FEE = 4;
    /**
     * @var int 活动赠送账户
     */
    const TYPE_ACTIVITY = 5;
    /**
     * @var int 系统充值账户
     */
    const TYPE_SYSTEM = 6;

    public $timestamps = false;

    protected $fillable = ['account_type', 'coin_id'];

    public function coin()
    {
        return $this->hasOne(Coin::class, 'id', 'coin_id');
    }
}
